import { createApp } from 'vue';
import { createPinia } from 'pinia';
import App from './App.vue';
import router from './router';
import { useUserStore } from '@/stores/auth';

// 引入Tailwind
import '@/assets/styles/tailwind.css';
// 引入Font Awesome
import 'font-awesome/css/font-awesome.min.css';

const app = createApp(App);

// 安装插件
const pinia = createPinia();
app.use(pinia);
app.use(router);

// 全局导航守卫 - 简化版，状态同步现在由GlobalAuthSync组件统一处理
router.beforeEach((to, from, next) => {
  console.log('======= 全局导航守卫 beforeEach 触发 =======');
  console.log('从路由:', from.path, '跳转到:', to.path);
  next();
});

app.mount('#app');